# coding: utf-8
from web import form

vlen = form.regexp(r".{2,140}$", '2到140个字')
#dlen = form.regexp(r".{3,16}$", 'must be between 3 and 16 characters')
dlen = form.regexp(r".{3,16}$", '3到16个字符')
dlen64 = form.regexp(r".{3,64}$", '3到64个字符')

t_form = form.Form(
    form.Textarea("tblog", vlen, description='', cols="48", rows="3"),
    form.Button("submit", type="submit", description="发布")
)

p_form = form.Form(
    # 没有设置domain,可以设置，设置后就不能再修改此值
    form.Hidden(name="uid"),
    form.Textbox("tdomain", dlen, description='域名', size="16", maxlength="16"),
    form.Dropdown("type", 
        args=[
            ('1','个人'),('2','企业'),('3','媒体'),
            ('4','组织'),('5','产品'),('6','专题'),
            ('7','社区'),
        ], 
        value='1', description="类型"),
    form.Textbox('tname', dlen, description="您的名字", size="16", maxlength="16"),
    form.Textarea('mydesc', dlen64, description="一句话介绍", cols="32", rows="2"),
    form.Button("submit", type="submit", description="修改")
)

